﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using HK2009.EntityQuery;

namespace HK2009.BusinessFacade
{
    /// <summary>
    /// 角色权限管理模块接口
    /// </summary>
    public interface IRolePurviewHandler
    {
        /// <summary>
        /// 获取所有权限列表
        /// </summary>
        /// <returns></returns>
        DataTable GetAllPurviewList();


        /// <summary>
        /// 根据sql语句同参数获取权限列表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        DataTable GetPurviewList(string sqlStr,SqlParameter[] parms);

        /// <summary>
        /// 根据权限ID获取权限信息
        /// </summary>
        /// <param name="purviewID"></param>
        /// <returns></returns>
        DataTable GetPurview(int purviewID);

        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="loginID">LoginID</param>
        /// <param name="password">password</param>
        /// <returns></returns>
        UsersQuery UserLogin(string loginID,string password);

        /// <summary>
        /// 根据sql语句同参数获取用户列表
        /// </summary>
        /// <param name="sqlStr"></param>
        /// <param name="parms"></param>
        /// <returns></returns>
        DataTable GetUsersList(string sqlStr, SqlParameter[] parms);

        /// <summary>
        /// 根据角色ＩＤ获取角色信息
        /// </summary>
        /// <param name="roleID"></param>
        /// <returns></returns>
        DataTable GetRoles(int roleID);

        /// <summary>
        /// 根据角色名获取角色信息
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        DataTable GetRolesList(string roleName);


        /// <summary>
        /// 传入Role实体，更新角色信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        bool UpdateRoles(RolesQuery query);

        /// <summary>
        /// 传入Role实体，添加角色信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        bool InsertRoles(RolesQuery query);

        /// <summary>
        /// 根据sql语句同参数获取角色列表
        /// </summary>
        /// <param name="sqlStr">sql语句</param>
        /// <param name="parms">参数</param>
        /// <returns></returns>
        DataTable GetRoleList(string sqlStr, SqlParameter[] parms);

        /// <summary>
        /// 获取所有角色
        /// </summary>
        /// <returns></returns>
        DataTable GetAllRoles();

        /// <summary>
        /// 根据roleID删除角色
        /// </summary>
        /// <param name="roleID"></param>
        /// <returns></returns>
        bool RoleDelete(int roleID);

        /// <summary>
        /// 根据userID删除用户
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        bool UserDelete(int userID);

        /// <summary>
        ///  更改用户信息
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="isActivity"></param>
        /// <returns></returns>
        bool UserUpdate(UsersQuery query);
       

        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
         bool UserInsert(UsersQuery query);

         /// <summary>
         /// 根据userID获取用户信息
         /// </summary>
         /// <param name="userID"></param>
         /// <returns></returns>
         UsersQuery GetUsers(int userID);

         int GetUserIDByLoginID(string loginID);
    }
}
